#ifndef FASYS_LIBS_API_SUBSCRIBE_JSON_HPP
#define FASYS_LIBS_API_SUBSCRIBE_JSON_HPP

#include "subscribe.hpp"
#include "names.hpp"
#include <fas/misc/json.hpp>

namespace fasys{ namespace api{

namespace aj = ::fas::json;
namespace ap = ::fas::pattern;


typedef
  aj::object<
    subscribe_base,
    ap::type_list_n<
        aj::member<n_channel, subscribe_base, std::string, &subscribe_base::channel>,
        aj::member<n_timeout, subscribe_base, time_t, &subscribe_base::timeout>
    >::type
  > subscribe_base_json;

typedef
  aj::object<
    subscribe_request,
    ap::type_list_n<
        subscribe_base_json::member_list
    >::type
  > subscribe_request_json;

typedef
  aj::object<
    subscribe_response,
    ap::type_list_n<
        subscribe_request_json::member_list,
        aj::member<n_channel_id, subscribe_response, channel_id_t, &subscribe_response::channel_id>,
        aj::member<n_count, subscribe_response, size_t, &subscribe_response::count>
    >::type
  > subscribe_response_json;


}}

#endif
